<?php
namespace User\Form;

use Zend\Form\Form;

class UserForm extends Form
{
    public function __construct($name = null)
    {
        // we want to ignore the name passed
        parent::__construct('user');

        $this->setAttribute('method', 'post');
        $this->add(array(
            'name' => 'id',
            'attributes' => array(
                'type'  => 'hidden',
            ),
        ));

        $this->add(array(
            'name' => 'username',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'User Name',
            ),
        ));
        
        $this->add(array(
            'name' => 'real_name',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'Real Name',
            ),
        ));
        
        $this->add(array(
            'name' => 'gender',
            //'attributes' => array(
                'type'  => 'Select',
            //),
            'options' => array(
                'label' => 'Gender',
                //'empty_option' => 'Please choose your language',
                'options' => array(
                    '1' => 'Male',
                    '2' => 'Female',
                    )
            ),
        ));

        $this->add(array(
            'name' => 'user_type',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'User Type',
            ),
        ));
        
        $this->add(array(
            'name' => 'email',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'Email',
            ),
        ));
        
        $this->add(array(
            'name' => 'phone_number',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'Phone Number',
            ),
        ));
        
        $this->add(array(
            'name' => 'address',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'Address',
            ),
        ));
        
        $this->add(array(
            'name' => 'note',
            'attributes' => array(
                'type'  => 'text',
            ),
            'options' => array(
                'label' => 'Note',
            ),
        ));

        $this->add(array(
            'name' => 'password',
            'attributes' => array(
                'type'  => 'password',
            ),
            'options' => array(
                'label' => 'Password',
            ),
        ));

        $this->add(array(
            'name' => 'submit',
            'attributes' => array(
                'type'  => 'submit',
                'value' => 'Go',
                'id' => 'submitbutton',
            ),
        ));

    }
}
